package org.noka.socketserver;
/**
 * 
 * @author rebin
 *
 */
public class NSocketServer {

	private NSocketServerUtil nSocketServerUtil=null;
	/**
	 * 服务入口方法
	 * @param NClient
	 * @param port
	 * @param cmax
	 */
	public NSocketServer(ClientInterface NClient,Integer port,Integer cmax,Integer disTimeOut){
		nSocketServerUtil = new NSocketServerUtil(port, cmax,NClient,disTimeOut);
	}
	public NSocketServer(ClientInterface NClient,Integer port,Integer cmax){
		nSocketServerUtil = new NSocketServerUtil(port, cmax,NClient);
	}
	public NSocketServer(ClientInterface NClient,Integer port){
		nSocketServerUtil = new NSocketServerUtil(port,NClient);
	}
	/**
	 * 启动服务，返回true启动成功，返回false启动失败
	 * @return
	 */
	public Boolean StartServer(){
		nSocketServerUtil.start();
		return nSocketServerUtil.getServerStatce();
	}
	/**
	 * 停止服务，返回true停止成功，返回false停止失败
	 * @return
	 */
	public Boolean stopServer(){
		nSocketServerUtil.stopServer();
		return nSocketServerUtil.getServerStatce();
	}
}
